<?php

namespace app\common\model\Product;

use think\Model;

/**
 * 商品分类模型
 */
class Type extends Model
{
    // 设置当前模型对应的完整数据表名称
    protected $table = 'pre_product_type';

    protected $append = [
        'thumb_text'
    ];

    public function getThumbTextAttr($value, $data)
    {
        $url = config('site.url');
 
        $thumb = !empty($data['thumb']) ? $url . $data['thumb'] : $url . '/assets/img/icon_type.png';

        return $thumb;
    }
}